package com.xoa.controller.supervision;


import com.xoa.model.supervision.Supervision;
import com.xoa.model.supervision.SupervisionApply;
import com.xoa.model.supervision.SupervisionType;
import com.xoa.service.supervision.SupervisionApplyService;
import com.xoa.service.supervision.SupervisionService;
import com.xoa.util.ToJson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * Created by 张丽军 on 2017/7/29.
 */
@RestController
@RequestMapping("/supApply")
public class SupervisionApplyController {
    @Autowired
    SupervisionApplyService supervisionApplyService;
    @Autowired
    SupervisionService supervisionService;


    /**
     * 创建作者：张丽军
     * 创建日期：2017-08-04
     * 方法介绍：督办任务状态接口(增加)
     * @param request
     * @param supervisionApply
     * @return
     */
    @ResponseBody
    @RequestMapping("/insertSupApply")
    public  ToJson<SupervisionApply> insertSupType(HttpServletRequest request,SupervisionApply supervisionApply){
        return supervisionApplyService.insertSupApply(request,supervisionApply);
    }

    /**
     * 创建作者：张丽军
     * 创建日期：2017-08-04
     * 方法介绍：督办任务状态接口(修改)
     * @param request
     * @param supervisionApply
     * @return
     */
    @ResponseBody
    @RequestMapping("/updateSupApply")
    public ToJson<SupervisionApply> getUpdateStatus(HttpServletRequest request,SupervisionApply supervisionApply){
        return supervisionApplyService.updateStatus(request,supervisionApply);
    }

    @ResponseBody
    @RequestMapping("/getSupApply")
    public ToJson<SupervisionApply> getStatusInfor(HttpServletRequest request,Integer status){
        return supervisionApplyService.getStatusInfor(request,status);
    }
    /**
     * 
     * 创建作者:   杨 胜
     * 创建日期:   2017-8-7 上午10:43:02
     * 方法介绍:   
     * 参数说明:   @param request
     * 参数说明:   @param status
     * 参数说明:   @return
     * @return     ToJson<SupervisionApply>
     */
    @ResponseBody
    @RequestMapping("/getSupApplyByStatus")
    public ToJson<SupervisionApply> getSupApply(HttpServletRequest request,SupervisionApply supervisionApply){
        return supervisionApplyService.getSupApplyByStatus(request,supervisionApply);
    }
}
